<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>驴妈妈统计系统</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/bootstrap.css" />
		<link rel="stylesheet" href="${request.contextPath}/static/assets/font-awesome/4.5.0/css/font-awesome.min.css" />
		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/jquery.gritter.min.css" />
		<!-- text fonts -->
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/fonts.googleapis.com.css" />
		<!-- ace styles -->
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/ace-rtl.min.css" />
		
		<link rel="stylesheet" href="${request.contextPath}/static/stylesheets/daterangepicker.css">
		<script src="${request.contextPath}/assets/js/jquery-2.1.4.min.js"></script>
	</head>

	<body class="no-skin" style="background-color: #FFF;">
		<div class="page-content" style="padding: 2px 2px 0px;">
		 	<div class="tabbable">
				<div class="tab-content">
			 		<div id="manage" class="tab-pane active in">
			 		<!-- 筛选条件开始 -->
					<div class="row">
						<div class="col-sm-12">
							<div class="widget-box">
								<div class="widget-header">
									<h4 class="widget-title lighter">
										<i class="ace-icon fa"></i>异常日志列表
									</h4>
								</div>
								<div class="widget-body" style="background-color: #EFF3F8;">
									<div class="widget-main">
										<form class="form-inline" id="searchForm" method="post" action="${request.contextPath}/backConfig/logList">
											<input type="hidden" id="_csrf" name="${_csrf.parameterName}" value="${_csrf.token}"/><!-- 框架原因，所有post请求必须加这行代码 -->
											<div class="form-group">
													<label for="exampleInputName2">日志类型
														<select name="logTypeVO" id="logTypeVO" aria-controls="dynamic-table" class="form-control input-sm" style="width:80px">
	                                                          <#list errorLogList as errorLog>
	                                                             <#if (logListConditionVO.logTypeVO) ??>
	                                                               <#if errorLog.value == logListConditionVO.logTypeVO  >
														      <option value="${errorLog.value}" selected>${errorLog.showName}</option>
														    <#else>
														      <option value="${errorLog.value}">${errorLog.showName}</option>
														    </#if>
														  <#else>
														      <option value="${errorLog.value}">${errorLog.showName}</option>
												         </#if>
														</#list>
													</select>
												</label>
												<label for="exampleInputName" style="margin-left: 30px;">公司编码
													<select name="companyVO" id="companyVO" aria-controls="dynamic-table" class="form-control input-sm" style="width:50px">
	                                                          <#list blackIpTypeList as sysCodeType>
	                                                           <#if (logListConditionVO.companyVO) ??>
	                                                             <#if logListConditionVO.companyVO ==sysCodeType.value >
														    <option value="${sysCodeType.value}" selected>${sysCodeType.showName}</option>
														   <#else>
														   <option value="${sysCodeType.value}">${sysCodeType.showName}</option>
														  </#if> 
														 <#else>
														   <option value="${sysCodeType.value}">${sysCodeType.showName}</option>
														 </#if>
														</#list>
													</select>
												</label>
												<label for="exampleInputName" style="margin-left: 30px;">任务批次号
													<input class="form-control" type="text" id="config-demo" name="taskVO" placeholder="任务批次号" value="${logListConditionVO.taskVO!}" style="width:100px"/>
												</label>
												<label for="exampleInputName" style="margin-left: 30px;">定时器编码
													<input class="form-control" type="text" id="config-demo" name="timerVO" placeholder="定时器编码" value="${logListConditionVO.timerVO!}" style="width:100px"/>
												</label>
												<button type="submit" class="btn btn-pink btn-sm">
													<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
													查询
												</button>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- 筛选条件结束 -->
				<!-- tab开始 -->
				<div class="row">
					 <div class="col-sm-12">
						<div class=" widget-box" style="border:none;">
							<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer" role="grid" aria-describedby="dynamic-table_info">
								<thead>
									<tr>
										<th>日志ID</th>
										<th>日志类型</th>
										<th>公司编码</th>
										<th>业务分类</th>
										<th>任务批次号</th>
										<th>定时器编码</th>
										<th>错误日志编码</th>
										<th>错误描述</th>
									</tr>
								</thead>
								<tbody>
									<#if logVOList?? && logVOList?size&gt;0>
										<#list logVOList as logVO>
											<tr class="">
												<td>${logVO.log_id!}</td>
												<#list errorLogList as errorLog>
												  <#if errorLog.value ==logVO.log_type >
												  	    <td>${errorLog.showName!}</td>
												  </#if>
												</#list> 	    
												<td>${logVO.company_code!}</td>
												<td>${logVO.busi_type!}</td>
												<td>${logVO.batch_num!}</td>
												<td>${logVO.timer_code!}</td>
												<td>${logVO.error_code!}</td>
												<td><#if logVO.error_desc?? && logVO.error_desc?length&gt;20>
				                                    ${logVO.error_desc?substring(0,20)}....<a onclick="showDetailLog('${(logVO.log_id)?c}')"><i class="ace-icon fa fa-eye"></i></a> <#else>
				                                    ${logVO.error_desc} </#if>
												</td>
											</tr>
										</#list>
									<#else>
										<tr>
											<td colspan="12">
												<div class="alert alert-danger" style="margin-bottom: 0px;" role="alert">没有记录!</div>
											</td>
										</tr>
									</#if>
								</tbody>
							</table>
							<#include "/paginator.html">
						</div>
					</div>
				</div>
				<!-- tab结束-->
			</div>
			
				<div class="row">
					<div class="col-xs-12">
						<button class="btn btn-info" data-toggle="modal" type="button"
							style="display: none;" id="update" data-target="#myModal">
						</button>
							<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
								aria-labelledby="myModalLabel" aria-hidden="true">
								<div class="modal-dialog">
									<div class="modal-content" style="width:800px; height:300px">
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal"
												aria-hidden="true">×</button>
											<h4 class="modal-title" id="myModalLabel"><strong>日志描述</strong></h4>
										</div>
										<div class="modal-body" id="logDetailMsc">
										</div>
									</div>
									<!-- /.modal-content -->
								</div>
								<!-- /.modal -->
							</div>
					</div>
				</div>						
				</div>
			</div>
		</div>
		<input type="hidden" id="loglistcontext" value="${request.contextPath}"/>
		<!-- basic scripts -->
		<script type="text/javascript">
		var loglistcontext = $("#loglistcontext").val();
		function showDetailLog(id){
			  $.ajax({
				    url : loglistcontext+'/backConfig/findLogByID?log_id='+id,
					type : "GET",
					success:function(data) {
						console.log(data);
						if(data.sessionStatus==540){//异步请求session过期状态
							window.location.href=loglistcontext+"/login";
							//location.href="show_product?prodId="+prod_id+"&sceneryName="+tdSceneryName+"&pageNum="+$("#pageNum").val();
						}else if(data.code=1){
							var LogVO = data.LogVO;
			                $("#myModal").modal("show");
			                $("#logDetailMsc").html(LogVO.error_desc);
						}
					}
			  });
		}	
		
		</script>
		<script src="${request.contextPath}/static/assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->
		<script type="text/javascript" src="${request.contextPath}/static/javascripts/moment.js"></script>
	   	<script type="text/javascript" src="${request.contextPath}/static/javascripts/daterangepicker.js"></script>
		<!-- ace scripts -->
		<script src="${request.contextPath}/static/assets/js/jquery.gritter.min.js"></script>
		<script src="${request.contextPath}/static/assets/js/ace-elements.min.js"></script>
		<script src="${request.contextPath}/static/assets/js/ace.min.js"></script>
		<!-- user scripts -->
		<script src="${request.contextPath}/static/assets/js/user/base.js"></script>
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/bsie-paginator.css" />
	</body>
</html>